   function SelectKeys(itemId){
   		document.getElementById("curr_ItemID").value = itemId;
        $("#ListChooseKeys").css({"display" : "block"});
   		var pos = getElementPos(itemId);
   		getPosLeft = pos.x  ;          //计算弹出层的top        
	    getPosTop = pos.y + 22;      
   		$("#ListChooseKeys").css({ "left": getPosLeft, "top": getPosTop });          //当浏览器窗口大小改变时   
	    $("#window_close").click( function(){  
	        $("#ListChooseKeys").css({"display" : "none"});
	    });
	    $("#selectKey_Cancel").click( function(){  
	        $("#ListChooseKeys").css({"display" : "none"});
	    });
	    $("#selectKey_OK").click( function(){  
	        getKeySets();
	    });
   }
   function getKeySets(){
        var keyStes = document.getElementsByName("keySte"); 
        var keysEx = "";
        for(i = 0; i < keyStes.length; i++){
        	if(keyStes[i].checked){
	        	keysEx = keysEx + keyStes[i].value + " ";
        	}
        }
        keysEx = keysEx.substring(0 , keysEx.length -1);
        var curr_ItemID = document.getElementById("curr_ItemID").value;
        document.getElementById(curr_ItemID).value = keysEx;
        $("#ListChooseKeys").css({"display" : "none"});
   }
  //解决IE中trim()不能使用的问题
  String.prototype.trim = function () {
	  return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' );
  }
  var selectCount = 1;
  function Select_Add(){
  	selectCount++;
  	$("#SelectContainer").append(
  	"<div class='rangeItem'>"
	+  "<span class='textSpan'>&nbsp;Selects:</span>  "
	+  "<input class='inputText' id='selects_"+selectCount+"' name='selects' value=''  readonly='readonly' />  "
	+  "<input type='button' id='setButton' value = 'Set' readonly='readonly' onclick='SelectKeys(\"selects_"+selectCount+"\")'  />   "
	+  "<a href='#' class='rangeRemove' onclick='Select_Delete(this)' ><img class='buttonBcImg' width='25' src='./images/delete.png' /></a>  "
	+  "<a href='#' class='rangeAdd' onclick='Select_Add()' ><img class='buttonBcImg' width='25' src='./images/add.png' /></a>"
	+"</div>"
  	);
  }
  function Select_Delete(obj){
  	
  	$(obj).parent().remove();
  	selectCount--;
  	if($("#SelectContainer").html().trim().length == 0){
  		Select_Add()
  	}
  }